package com.program.facesigninsystem.service.impl;

import com.program.facesigninsystem.dao.IUserInfoDao;
import com.program.facesigninsystem.entity.UserInfo;
import com.program.facesigninsystem.service.IUserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserInfoService implements IUserInfoService {
    @Autowired
    private IUserInfoDao iUserInfoDao;

    @Override
    public UserInfo loginUser(String openid){
        UserInfo userInfo = iUserInfoDao.loginUser(openid);
        return userInfo;
    }

    @Override
    public void updateToken(String uid,String token) {
        iUserInfoDao.updateToken(uid,token);
    }

    @Override
    public void addUser(String uid, String openid,String token) {
        iUserInfoDao.addUser(uid,openid,token);
    }

    @Override
    public void updateUser(String uid, String name, int type, String major, String uclass, String university, String academy) {
        iUserInfoDao.updateUser(uid, name, type, major, uclass, university, academy);
    }

    @Override
    public UserInfo selectUser(String uid) {
        UserInfo userInfo=iUserInfoDao.selectUser(uid);
        return userInfo;
    }
}
